<?
 	session_start();
 	require("checksessionsodaubai.php");
 	require("connect.php"); 
?>
<html><!-- InstanceBegin template="/Templates/sodaubaitemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javascript" src="scripts/innovaeditor.js"></script>
<link rel="stylesheet" type="text/css" href="css/engine.css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script language="javascript" type="text/javascript" src="js/datetimepicker.js">
</script>
</head>
<body>
<table align="center" width="938" cellpadding="0" cellspacing="0" border="0">
	<tr><td colspan="2" height="26" bgcolor="#CCCCCC">
	<? $malop=$_REQUEST["mal"];
	$resu99=mysql_query("select * from lop where mal='{$malop}'");
		$row99=mysql_fetch_array($resu99);
	?>	
	<!--Menu 1-->
	<div id="tool">

	<a href="index.php">Trang chủ trường</a>
		 | 
		  <a href="hotrohoctap.php">Hỗ trợ học tập</a>
		  |		
		<a href="lienhe.php">Liên hệ</a>
	</div>
	<!--het menu 1-->
	</td></tr>
	<tr><td colspan="2" height="34" bgcolor="#CCCCCC">
	<div id="menuwrapper">
		<ul id="p7menubar">
			 <li><a class="trigger" href="lopcuatoi.php?mal=<? echo $malop;?>" target="_self">Trang chủ <? echo $row99["tenl"];?></a></li>										  	
		  <li class="linemenus"></li>					 
		  <li>
		  <?
		  	if ($_SESSION["login"]!=true){
		  ?>		  
		  <a class="trigger" href="login.php" target="_self">Trang cá nhân</a>
		  <? } else {
		  		if($_SESSION["quyen"]==0) {
		  ?>	
		   			<a class="trigger" href="admin/index.php" target="_self">Trang cá nhân</a>
		  		<? } else if($_SESSION["quyen"]==1) {?>
					<a class="trigger" href="giaovien.php?magv=<? echo $_SESSION["username"];?>" target="_self">Trang cá nhân</a>
				<? } else if($_SESSION["quyen"]==2) {?>
					<a class="trigger" href="trangphuhuynh.php?maph=<? echo $_SESSION["username"];?>&mal=<? echo $malop;?>" target="_self">Trang cá nhân</a>
				<? } else if(($_SESSION["quyen"]==3) || ($_SESSION["quyen"]==4)) {?>
					<a class="trigger" href="tranghocsinh.php?mahs=<? echo $_SESSION["username"];?>&mal=<? echo $malop;?>" target="_self">Trang cá nhân</a>
				<? }?>
		  		
		  <? }?>
		  <!--bat dau phan dang nhap-->
		  <?
				if ($_SESSION["login"]!=true){
			?>
			 <li class="linemenus"></li>					 
		  	 <li><a class="trigger" href="login.php" target="_self">Đăng nhập</a>			
			<? }else{?>
			 <li class="linemenus"></li>					 
		  	 <li><a class="trigger" href="logout.php" target="_self">Thoát</a>			
			 <li class="linemenus"></li>
			 <li><a class="trigger">
			 	<?
		$nguoidung=$_SESSION["username"];
		if($_SESSION["quyen"]==0){
		$resu23=mysql_query("select * from admin where maadmin='{$nguoidung}'");
		$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }else if($_SESSION["quyen"]==1){
			$resu23=mysql_query("select * from giaovien where magv='{$nguoidung}'");
			$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }else if($_SESSION["quyen"]==2){
			$resu23=mysql_query("select * from phuhuynh where maph='{$nguoidung}'");
			$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["tenph"]; ?>
			</font>
		<? }else if(($_SESSION["quyen"]==3)||($_SESSION["quyen"]==4)){
				$resu23=mysql_query("select * from hocsinh where mahs='{$nguoidung}'");
				$row23=mysql_fetch_array($resu23);
		?>
			<font color="#FFFFFF">			 
			<? echo "Xin chào : ".$row23["hotendem"]."&nbsp;".$row23["ten"]; ?>
			</font>
		<? }
	}?>
		  <!--het-->		 
		</ul>
	</div>
	</td></tr>
	<tr>
		<td width="160px" height="800" valign="top">
		<!--menu trai-->		
		<table align="center" width="100%" border="1" cellpadding="0" cellspacing="0">
		<tr><td valign="middle" height="30">
			<a href="sodaubai.php?mal=<? echo $malop;?>"><img src="anh/sodaubai.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="sodaubai.php?mal=<? echo $malop;?>">Sổ đầu bài</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="danhsachhocsinh.php?mal=<? echo $malop;?>"><img src="anh/user.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="danhsachhocsinh.php?mal=<? echo $malop;?>">Danh sách học sinh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thuvienanhlop.php?mal=<? echo $malop;?>.php"><img src="anh/album.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thuvienanhlop.php?mal=<? echo $malop;?>">Thư viện ảnh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="lopcuatoi_baiviet.php?mal=<? echo $malop;?>"><img src="anh/baiviet.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="lopcuatoi_baiviet.php?mal=<? echo $malop;?>">Bài viết</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thoikhoabieu.php?mal=<? echo $malop;?>"><img src="anh/thoikhoabieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thoikhoabieu.php?mal=<? echo $malop;?>">Thời khóa biểu</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="thongbaolop.php?mal=<? echo $malop;?>"><img src="anh/thongbao.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="thongbaolop.php?mal=<? echo $malop;?>">Thông báo</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="tailieulop.php?mal=<? echo $malop;?>""><img src="anh/tailieu.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="tailieulop.php?mal=<? echo $malop;?>">Tài liệu Upload</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="xemdiemlop.php?mal=<? echo $malop;?>""><img src="anh/xemdiem.png" height="16" width="16" border="0">&nbsp;&nbsp;</a><a href="xemdiemlop.php?mal=<? echo $malop;?>">Xem điểm</a>
		</td></tr>			
		</table>
		<!-- het menu trai-->
	</td>
		
    <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" -->		
	<!--Begin -->
		<table align="right" width="99%" cellpadding="2" cellspacing="2" border="0">
		<tr>
			<td align="center">
			<!--Begin tieu de-->
				<div class="sodaubai">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="noidungsodaubai">
						<h1></h1>
							<font size="+2" color="#003366">
								Sổ đầu bài lớp <? 
								$mal=$_REQUEST["mal"];
								$result=mysql_query("select * from lop where mal='{$mal}'");
								$r=mysql_fetch_array($result);
								echo $r["tenl"];
								?>	
							</font>																		 
						<div class="gift_quatang_mView">
							<span style="float:left; width:100px;"> 
							</span>
							<span style=" float: right;">
												 <font color="#476da4">
												 </font>			
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>			
				</div>
			<!--End tieu de-->			
			<!--Begin them nhan xet-->
				<div class="sodaubai">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="noidungsodaubai">
						<h1 align="left"><font color="cc3333">Thêm mới nhận xét</font></h1>
					<form name="f" action="themsodaubai_action.php" method="post">
                  <table width="95%" border="1" cellspacing="0" cellpadding="5">
                    <tr>
                      <th valign="top" align="left">Ngày </th>
					  <td>
					  <input type="hidden" name="lopid" id="lopid" value="<? echo $mal;?>">
					  <? $ngay=date("d-m-Y");?>
                     <input name="demol1" id="demo11" type="text" size="25" value="<? echo $ngay;?>"><a href="javascript:NewCal('demo11','ddmmyyyy')"><img src="anh/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
					 </td>
                    </tr>
					<tr>
                      <th align="left">Học sinh vắng</th>
                      <td align="left">
					  <table align="center" width="100%" cellpadding="5" cellspacing="0" border="0">
							  <?
							  $j=0;
							  $result3=mysql_query("select * from hocsinh where mal='{$mal}'");
							  if(mysql_num_rows($result3)<=0){
								echo "Lớp chưa có học sinh nào";
							  }	else {
							  ?>
									  <?									
											$chon=$_REQUEST["option"];
											if($chon==them){
												$j=$_REQUEST["soluong"] + 1;
												$n=0;
												$n2=1;	
												while($n<$j){	
													$n++;
													$n2=$n*10;									
										?>				
										<tr><td>																											
											<select name="<? echo $n;?>" id="<? echo $n;?>">
												<?
													$result4=mysql_query("select * from hocsinh where mal='{$mal}'");
													while($r4=mysql_fetch_array($result4)){
												?>
												<option value="<? echo $r4["mahs"];?>"> <? echo $r4["hotendem"];echo "&nbsp;";echo $r4["ten"];?></option>												
												<? }?>
											</select>&nbsp;&nbsp;
											<select name="<? echo $n2;?>">
												<option value="0">Nghỉ có phép</option>
												<option value="1">Nghỉ không phép</option>
												<option value="2">Muộn</option>												
											</select>
										</td></tr>
									  <? }}?>									  							 							
								 <tr><td>
									<input type="button" value="Thêm học sinh" onClick="location.href='?option=them&soluong=<? echo $j;?>&mal=<? echo $mal;?>'">
									<input type="button" value="Bỏ qua" onClick="location.href='?option=them&soluong=-1&mal=<? echo $mal;?>'">
								 </td></tr>
							   <? }?>
					   </table>
					  </td>
                    </tr>	
                    <tr> 
                      <th valign="top" align="left">Tiết học</th>
                      <td><input type="text" name="tiethoc"></td>
                    </tr>
                    <tr>
                      <th valign="top" align="left">Môn học</th>
                      <td><select name="mamh" id="mamh">
					  	<?
						$result1=mysql_query("select * from monhoc order by tenmh");
						while($r1=mysql_fetch_array($result1)){
						?>
						<option value="<? echo $r1["mamh"];?>">&nbsp;<? echo $r1["tenmh"];?>&nbsp;</option>
						<? }?>
					  </select></td>
                    </tr>
					<tr>
						<th align="left">Tiếp theo PPCT</th>
						<td><input type="text" name="ppct"></td>
					</tr>
									
                    <tr>
                      <th align="left">Đầu bài hay nội dung công việc</th>
                      <td><input type="text" name="baihoc" size="59"></td>
                    </tr>
                    <tr>
                      <th align="left">Nhận xét</th>
                      <td><textarea name="nhanxet" cols="45" rows="5"></textarea></td>
                    </tr>					
                    <tr>
                      <th align="left">Xếp loại</th>
                      <td>
					  	<select name="xeploai" id="xeploai">
							<option value="1">Tốt</option>
							<option value="2">Khá</option>
							<option value="3">Trung bình</option>
							<option value="4">Yếu</option>
							<option value="5">Kém</option>
						</select>
					  </td>
                    </tr>
                    <tr>
                      <th align="left">Giáo viên</th>
                      <td>
					  	<?
						$magv=$_SESSION["username"];
						$result5=mysql_query("select * from giaovien where magv='{$magv}'");
						$r5=mysql_fetch_array($result5);
						echo $r5["hotendem"];echo "&nbsp;";echo $r5["ten"];
						?>
					  	<input type="hidden" name="gvid" id="gvid" value="<? echo $magv;?>">
						</td>
                    </tr>
                    <tr>
						<input type="hidden" name="hocsinhvang" id="hocsinhvang" value="<? echo $j;?>">
                      <td align="right" valign="top"><input type="submit" name="Submit" value="Thêm" onClick="return kt();"></td>
                      <td align="left"><input type="reset" name="Submit2" value="Reset"></td>
                    </tr>
					<script language="JavaScript">
						function kt(){
							if(f.tiethoc.value=="")
							{
								alert("Tiết học không được để trống !");
								f.tiethoc.focus();
								return false;
							}
							r=/^\d+$/;
							if(r.test(f.tiethoc.value)==false)
							{
								alert("Tiết học phải là số tự nhiên lớn hơn 0!");
								f.tiethoc.focus();
								return false;
							};  
							if(f.baihoc.value=="")
							{
								alert("Bài học không được để trống !");
								f.baihoc.focus();
								return false;
							}
							if(f.nhanxet.value=="")
							{
								alert("Nhận xét của giáo viên không được để trống !");
								f.nhanxet.focus();
								return false;
							}							
							return true;
						}
					</script>
                  </table>
                </form>
						<div class="sodaubai_bottom">
							<span style="float:left; width:100px;">
						<!--Neu la giao vien thi hien link-->
								
							</span>
							<span style=" float: right;">
												 <font color="#476da4">
								
												 </font>			
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>			
				</div>
			<!--End them nhan xet-->
			
			</td>
		</tr>
		</table>
	<!--End-->	
	<!-- InstanceEndEditable --></td>
	
	</tr>
	<tr><td colspan="2" align="center" valign="middle" bgcolor="#999999" height="100">Phạm Đức Đóa - Khoa CNTT - Đại học Xây Dựng</td></tr>
</table>
</body>
<!-- InstanceEnd --></html>
